// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

const int MOD = 998244353;
typedef long long LL;

const int N = 4e5+50;

int t, n, m;

LL f[N], invf[N];

LL bin(LL a, LL b, LL p = MOD) {
    LL res = 1;
    for (; b; b>>=1, a=a*a%p)
        if (b & 1)
            res = res * a % p;
    return res;
}

inline LL C(int n, int m) {
    if (n < m) return 0;
    return f[n] * invf[m] % MOD * invf[n-m] % MOD;
}

int main(int argc, char const *argv[]) {
    // code

    f[0] = invf[0] = 1;
    for (int i=1; i<N; ++i) {
        f[i] = f[i-1] * i % MOD;
    }
    invf[N-1] = bin(f[N-1], MOD-2, MOD);
    for (int i=N-2; i>=1; --i)
        invf[i] = invf[i+1] * (i+1)%MOD;

    // cout << C(100, 2) << endl;

    scanf("%d%d", &n, &m);
    LL ans = 0;
    for (int i=2; i<n; ++i)
        ans = (ans + C(n-2, i-1) * (i - 1)) % MOD;
    ans = ans * C(m, n-1) % MOD;
    // ans = ans * (MOD + 1) / 2 % MOD;
    cout << ans << endl;

    return 0;
}
